package enum

type OrderStatus string

const (
	TREADING    OrderStatus = "TREADING"
	CANCELED OrderStatus = "CANCELED"
	COMPLETED      OrderStatus = "COMPLETED"
	OVERTIMED  OrderStatus = "OVERTIMED"  //超时
	WAITING_TRIGGER OrderStatus = "WAITING_TRIGGER" //等待触发
	FORCE OrderStatus="FORCE"  //强平

)

func (o OrderStatus) String() string {
	switch o {
	case TREADING:
		return "TREADING"
	case CANCELED:
		return "CANCELED"
	case COMPLETED:
		return "COMPLETED"
	case OVERTIMED:
		return "OVERTIMED"
	case WAITING_TRIGGER:
		return "WAITING_TRIGGER"
	case FORCE:
		return "FORCE"
	default:
		return "unknown"
	}
}

func (o OrderStatus) Valid() bool {
	if o.String() == "unknown" {
		return false
	}
	return true
}
